import axios from '@/common/request.js';

//添加商品到购物车
export const cartAdd = payload => axios({
	url: `/cart/add`,
	method: 'post',
	payload
})

//订单提交前的检验和填写相关订单信息
export const cartCheckOut = payload => axios({
	url: `/cart/checkout`,
	method: 'post',
	payload
})

//删除某个购物车商品
export const cartDel = payload => axios({
	url: `/cart/delete`,
	method: 'post',
	payload
})

//获取购物车中的数据
export const getCart = payload => axios({
	url: `/cart/getCart`,
	method: 'post',
	payload
})

//获取购物车商品的总件件数
export const cartGoodsCount = payload => axios({
	url: `/cart/goodscount`,
	method: 'post',
	payload
})

//获取购物车信息
export const cartIndex = payload => axios({
	url: `/cart/index`,
	method: 'post',
	payload
})

//减少商品到购物车
export const cartMinus = payload => axios({
	url: `/cart/minus`,
	method: 'post',
	payload
})

//更新指定的购物车信息
export const cartUpdate = payload => axios({
	url: `/cart/update`,
	method: 'post',
	payload
})

//清空购物车
export const cartCLear = payload => axios({
	url: `/cart/clear`,
	method: 'post',
	payload
})